package _12FileOutPutStream一次写一个字节数组;

import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class Demo2 {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\黑马java培训班\\代码\\itcast\\JavaSE\\day10\\abd\\bg.jpg");
        FileOutputStream fos = new FileOutputStream("D:\\黑马java培训班\\代码\\itcast\\JavaSE\\day10\\abd\\bg.jpg");

        byte[] b = new byte[1024];
        int read;

        while ((read=fis.read())!=-1){
            fos.write(b,0,read);
        }
    }
}
